package com.rzjm.api.netty.water;

import com.rzjm.api.netty.water.entity.ReceiveData;
import io.netty.channel.ChannelPromise;
import lombok.Data;

@Data
public class ResponseData {

    /**
     * 参考 ResultCodeEnum
     */
    private int code;

    private String msg;

    private String receiveDataStr;

    private ReceiveData receiveData;

    private ChannelPromise promise;


    public ResponseData(int code, String msg, String receiveDataStr, ReceiveData receiveData) {
        this.code = code;
        this.msg = msg;
        this.receiveDataStr = receiveDataStr;
        this.receiveData = receiveData;
    }

    public static ResponseData getInstance(int code) {
        return new ResponseData(code, null,null, null);
    }

    public static ResponseData getInstance(int code, String msg) {
        return new ResponseData(code, msg, null, null);
    }

    public static ResponseData getInstance(int code, String msg, String receiveDataStr, ReceiveData receiveData) {
        return new ResponseData(code, msg, receiveDataStr, receiveData);
    }
}
